/* Copyright (c) 2004-2024 peigen.info. All rights reserved. */

package info.peigen.hotpot.manage.core.service.processor.create;

import info.peigen.hotpot.common.service.base.processor.Processor;
import info.peigen.hotpot.common.service.base.processor.ProcessorServiceContext;
import info.peigen.hotpot.manage.core.domain.Role;
import info.peigen.hotpot.manage.core.service.order.RoleCreateOrder;
import info.peigen.hotpot.manage.core.service.processor.AbstractHotpotManageServiceProcessor;
import info.peigen.hotpot.manage.core.util.convertor.RoleConvertor;
import org.noear.solon.annotation.Component;

/**
 * <b>(RoleCreateProcessor)</b>
 * "角色" 创建处理器
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2024-06-28
 */
@SuppressWarnings({"rawtypes"})
@Component
public class RoleCreateProcessor extends AbstractHotpotManageServiceProcessor implements Processor {
    @Override
    public Integer level() {
        return 25;
    }

    @Override
    public void execute(ProcessorServiceContext serviceContext) {
        RoleCreateOrder order  = (RoleCreateOrder) serviceContext.getOrder();
        Role            domain = RoleConvertor.INSTANCE.convertToDomain(order);
        serviceContext.setDomain(domain);
    }

}